import { Notification, MessageBox, Message,Loading } from 'element-ui'

/**
 * 遮罩
 //开启loading 提示
 const load = msgLoading();
 关闭loading
 load.close();
 * @param msg
 * @return {ElLoadingComponent}
 */
export function msgLoading(msg='拼命处理中,请耐心等待'){
    let options={
        lock: true,
        text: msg,
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
    }
    return Loading.service(options);
}

export function msgSuccess(msg="操作成功",dangerouslyUseHTMLString=false) {
    Message({ dangerouslyUseHTMLString: dangerouslyUseHTMLString,showClose: true, message: msg, type: "success" });
}

export function msgError(msg,dangerouslyUseHTMLString=false) {
    Message({ dangerouslyUseHTMLString: dangerouslyUseHTMLString,showClose: true, message: msg, type: "error" });
}

export function msgInfo(msg) {
    Message.info(msg);
}
